home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pine / imap-3.0 / ANSI / c-client / mh.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-29  |  6.2 KB  |  143 lines

  1. /*
  2.  * Program:    MH mail routines
  3.  *
  4.  * Author(s):    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  *        Andrew Cohen
  13.  *        Internet: cohen@bucrf16.bu.edu
  14.  *
  15.  * Date:    23 February 1992
  16.  * Last Edited:    29 October 1992
  17.  *
  18.  * Copyright 1992 by the University of Washington
  19.  *
  20.  *  Permission to use, copy, modify, and distribute this software and its
  21.  * documentation for any purpose and without fee is hereby granted, provided
  22.  * that the above copyright notice appears in all copies and that both the
  23.  * above copyright notice and this permission notice appear in supporting
  24.  * documentation, and that the name of the University of Washington not be
  25.  * used in advertising or publicity pertaining to distribution of the software
  26.  * without specific, written prior permission.  This software is made
  27.  * available "as is", and
  28.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  29.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  30.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  31.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  32.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  33.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  34.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  35.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  36.  *
  37.  */
  38.  
  39. /* Build parameters */
  40.  
  41. #define MHRC strcat (strcpy (tmp,myhomedir ()),"/.mhrc")
  42.  
  43.  
  44. /* Command bits from mh_getflags() */
  45.  
  46. #define fSEEN 1
  47. #define fDELETED 2
  48. #define fFLAGGED 4
  49. #define fANSWERED 8
  50.  
  51.  
  52. /* MH I/O stream local data */
  53.     
  54. typedef struct mh_local {
  55.   unsigned int dirty : 1;    /* disk copy of .mhrc needs updating */
  56.   char *dir;            /* spool directory name */
  57.   char *buf;            /* temporary buffer */
  58.   unsigned long buflen;        /* current size of temporary buffer */
  59.   unsigned long *number;    /* mh message numbers */
  60.   char **header;        /* message headers */
  61.   char **body;            /* message bodies */
  62.   char *seen;            /* local seen status */
  63. } MHLOCAL;
  64.  
  65.  
  66. /* Convenient access to local data */
  67.  
  68. #define LOCAL ((MHLOCAL *) stream->local)
  69.  
  70. /* Function prototypes */
  71.  
  72. DRIVER *mh_valid (char *name);
  73. int mh_isvalid (char *name,char *tmp);
  74. void *mh_parameters (long function,void *value);
  75. char *mh_file (char *dst,char *name);
  76. void mh_find (MAILSTREAM *stream,char *pat);
  77. void mh_find_bboards (MAILSTREAM *stream,char *pat);
  78. void mh_find_all (MAILSTREAM *stream,char *pat);
  79. void mh_find_all_bboards (MAILSTREAM *stream,char *pat);
  80. long mh_subscribe (MAILSTREAM *stream,char *mailbox);
  81. long mh_unsubscribe (MAILSTREAM *stream,char *mailbox);
  82. long mh_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  83. long mh_unsubscribe_bboard (MAILSTREAM *stream,char *mailbox);
  84. long mh_create (MAILSTREAM *stream,char *mailbox);
  85. long mh_delete (MAILSTREAM *stream,char *mailbox);
  86. long mh_rename (MAILSTREAM *stream,char *old,char *new);
  87. MAILSTREAM *mh_open (MAILSTREAM *stream);
  88. int mh_select (struct direct *name);
  89. int mh_numsort (struct direct **d1,struct direct **d2);
  90. void mh_close (MAILSTREAM *stream);
  91. void mh_fetchfast (MAILSTREAM *stream,char *sequence);
  92. void mh_fetchflags (MAILSTREAM *stream,char *sequence);
  93. ENVELOPE *mh_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  94. char *mh_fetchheader (MAILSTREAM *stream,long msgno);
  95. char *mh_fetchtext (MAILSTREAM *stream,long msgno);
  96. char *mh_fetchbody (MAILSTREAM *stream,long m,char *s,unsigned long *len);
  97. void mh_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  98. void mh_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  99. void mh_search (MAILSTREAM *stream,char *criteria);
  100. long mh_ping (MAILSTREAM *stream);
  101. void mh_check (MAILSTREAM *stream);
  102. void mh_expunge (MAILSTREAM *stream);
  103. long mh_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  104. long mh_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  105. long mh_append (MAILSTREAM *stream,char *mailbox,STRING *message);
  106. void mh_gc (MAILSTREAM *stream,long gcflags);
  107. short mh_getflags (MAILSTREAM *stream,char *flag);
  108. char mh_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  109. char mh_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  110. char mh_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  111. char mh_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  112. char mh_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  113. char mh_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  114. char mh_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  115. char mh_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  116. char mh_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  117. char mh_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  118. char mh_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  119. char mh_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  120. char mh_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  121. char mh_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  122. char mh_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  123. char mh_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  124. char mh_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  125. unsigned long mh_msgdate (MAILSTREAM *stream,long msgno);
  126. char mh_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  127. char mh_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  128. char mh_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  129. char mh_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  130. char mh_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  131. char mh_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  132. char mh_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  133. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  134. search_t mh_search_date (search_t f,long *n);
  135. search_t mh_search_flag (search_t f,char **d);
  136. search_t mh_search_string (search_t f,char **d,long *n);
  137.  
  138. /* This is embarassing */
  139.  
  140. extern char *bezerk_file (char *dst,char *name);
  141. extern int bezerk_lock (char *file,int flags,int mode,char *lock,int op);
  142. extern void bezerk_unlock (int fd,MAILSTREAM *stream,char *lock);
  143.